package com.le.tester.book.concurrentjavafight.l6_3_6;


import java.util.concurrent.CompletionService;
import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * createTime：2022/10/21 13:42
 * description：批量执行多个异步任务
 */
public class Renderer {

    private final ExecutorService executor = Executors.newCachedThreadPool();

    //需要知道当前的异步任务执行的任务

    void renderer() {
        //对于CompletionService共享一个ExecutorService
        CompletionService<String> completionServiceStr = new ExecutorCompletionService<>(executor);
        CompletionService<Integer> completionServiceInt = new ExecutorCompletionService<>(executor);

        //检索并且移除下一个Task
        // completionService.take();
    }


}
